package com.npf.imgserver.common.base;


import com.npf.imgserver.common.enums.ResultCodeEnum;

import java.io.Serializable;
/**
 * Created with IDEA
 * author: NiPengFei
 * Date:18/9/22
 * Time:下午10:52
 */
public class ResultBase<T>  implements Serializable {

    public ResultBase(ResultCodeEnum codeEnum) {
        this.codeEnum = codeEnum;
    }

    public ResultBase(ResultCodeEnum codeEnum, T data) {
        this.codeEnum = codeEnum;
        this.data = data;
    }

    /**
     * 返回code+msg
     */
    private ResultCodeEnum codeEnum;

    /**
     * 返回数据
     */
    private T data;

    public String getCode() {
        return codeEnum.getCode();
    }

    public String getMessage() {
        return codeEnum.getMessage();
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public void setCodeEnum(ResultCodeEnum codeEnum) {
        this.codeEnum = codeEnum;
    }
}